//
//  ScrollTableViewCell.m
//  CarStop
//
//  Created by lanou3g on 15/7/20.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "ScrollTableViewCell.h"
#import "MationList.h"

@implementation ScrollTableViewCell

//- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
//
//    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
//    if (self) {
//
//        
//    }
//    return self;
//}


- (void)setMList:(MationList *)mList{

    if (_mList != mList) {
        
        
    }
    self.newestCellScrollView.contentSize = CGSizeMake(self.frame.size.width * 6, self.frame.size.height);
    self.newestCellScrollView.pagingEnabled = YES;
    self.newestCellScrollView.showsHorizontalScrollIndicator = NO;
    self.newestCellScrollView.showsVerticalScrollIndicator = NO;

    if (self.mList.scrollPhoto) {
        for (int i = 0; i < 6; ++i) {
            self.scrollImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.newestCellScrollView.frame.size.width * i, 0, self.newestCellScrollView.frame.size.width, self.newestCellScrollView.frame.size.height)];
            self.scrollImageView.image = self.mList.scrollPhoto;
            [self.newestCellScrollView addSubview:self.scrollImageView];
            
        }
        NSLog(@"读取mList的set方法");
    }else{
        for (int i = 0; i < 6; ++i) {
            self.scrollImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.newestCellScrollView.frame.size.width * i, 0, self.newestCellScrollView.frame.size.width, self.newestCellScrollView.frame.size.height)];
            self.scrollImageView.image = [UIImage imageNamed:@"Carrr"];
            [self.mList downloadScrollPic];
            [self.newestCellScrollView addSubview:self.scrollImageView];
            
        }
        NSLog(@"读取mList的set方法");
    }
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


@end
